<template>
	<view>
		<view v-if="shh" style="height: 30px;"></view>
		<view class="posirem flex-a-i " :class="theme?'bg141414 colorfff':'bgfff'" :style="{background:toprg,paddingTop:shh+'px'}">
			<view class="flex-ju-b wf   posire">
				 <image @click="back" mode="widthFix" class="image width32 flex" :src="theme?'/static/img/back.png':'/static/img/hback.png'"></image>
				 <view v-if="sou" class="posire flex1 flex-ju-b bgsou">
					 <view class="flex-a-i">
						 <image mode="widthFix" class="image socud" src="/static/img/sou.png"></image>
						 <input v-model="values" confirm-type="search" @confirm="confirm" style="padding-left: 10px;" placeholder="输入搜索"/>
					 </view>
					 <uni-icons @click="values = ''" type="closeempty" color="#999999" size="15"></uni-icons>
				 </view>
				 
				 <view class="size32" :style="{paddingLeft:right+'rpx'}">{{title}}</view>
				
				 <view v-if="right" class="kong">
					<view @click="tapright"  :style="{color:color}">
						<slot></slot>
					</view>
				</view>
				<view v-else class="kong">
				</view>
			</view>
		</view>
		<view style="height:100rpx"></view>
	</view>
</template>


<script >
	export default {
		name:"back",
		props: {
			title: {
				type: String,
				default: ''
			},
			title2: {
				type: String,
				default: ''
			},
			sou: {
				type: String,
				default: ''
			},
			color: {
				type: String,
				default: '#000'
			},
			toprgb: {
				type:[String,Number],
				default:''
			},
			isxiao: {
				type:[String,Number],
				default:''
			},
			right: {
				type:[String,Number],
				default:''
			},
		},
		data() {
			return {
				 tindex:0,
				 theme: uni.getStorageSync('theme'),
				 values:""
			}
		},
		computed:{
			toprg(){
				return 'rgba(0,0,0,'+this.toprgb+')'
			}
		},
		methods:{
			confirm(){
				this.$emit('confirm',this.values)
			},
			tapright(){
				this.$emit('tapright')
			},
			tapang(index){
				this.tindex = index
				this.$emit('tapang',index)
			},
		},
		mounted () {
			 
		},
		created() {
		}
	}
</script>

<style>
	
	.bgsou{
		background: #1C1C1C;
		padding: 8px 10px;
		border-radius: 5px;
		margin-right: 10rpx;
	}
	.socud{
		width: 24.57rpx;
	}
	.wf{
		width: 100%;
	}
	.posirem{
		height: 100rpx;
		width: 92% ;
		position: fixed;
		z-index: 90;
		top: 0;
	}
.kong{
	min-width: 32rpx;
}
</style>